
from database.database import Database
from models.parktoken import DbParkToken

class ParkTokenTable(Database):

    def __init__(self):
        self.table_name = 'park_tokens'

    def insert(self, data : DbParkToken):
        sql = self.get_insert_sql_from_obj(data, self.table_name)
        self.execute(sql)
        return int(self.cursor.lastrowid)

    def update(self, data : DbParkToken): 
        sql = self.get_update_sql_from_obj(data, self.table_name)
        self.execute(sql)